#ifndef DELEGATE_H
#define DELEGATE_H

#include <QStyledItemDelegate>
#include <QPushButton>
#include <QSqlDatabase>

namespace Delegates{

class ComboDelegate: public QStyledItemDelegate
{
    Q_OBJECT    
    public :
    ComboDelegate(QObject * parent = 0);
    ~ComboDelegate();

    QSize sizeHint(const QStyleOptionViewItem &option,
                   const QModelIndex &index ) const;
    QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option,
                           const QModelIndex &index) const;
    void setEditorData(QWidget *editor, const QModelIndex &index) const;
    void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const;
};

class DateDelegate: public QStyledItemDelegate
{
    Q_OBJECT    
    public :
    DateDelegate(QObject * parent = 0);
    ~DateDelegate();

    QSize sizeHint(const QStyleOptionViewItem &option,
                   const QModelIndex &index ) const;
    QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option,
                           const QModelIndex &index) const;
    void setEditorData(QWidget *editor, const QModelIndex &index) const;
    void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const;
};

};


#endif

